package com.atde._04_structural_design_patterns.adapter.objectadapter;



/**
 * @BelongsProject: hsp_java_design_mode
 * @BelongsPackage: com.atde._04_structural_design_patterns.adapter.objectadapter
 * @Author: Del
 * @CreateTime: 2025-06-18  20:33
 * @Description: 适配器模式 --- 对象适配器模式 --- 手机 --- 接入适配器进行充电
 * @Version: 1.0
 */
public class Phone {
    public void charging (IVoltage5V iVoitage5V) {
        if (iVoitage5V.output5V() == 5) {
            System.out.println("电压为5V, 可以充电");
        } else if (iVoitage5V.output5V() > 5) {
            System.out.println("电压不匹配，不能充电");
        }
    }
}
